package com.ieasy.module.system.web.action;

import javax.inject.Inject;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ieasy.basic.model.DataGrid;
import com.ieasy.basic.model.Msg;
import com.ieasy.basic.util.cons.Const;
import com.ieasy.module.common.web.action.BaseController;
import com.ieasy.module.oa.project.service.ICompanyProjectQuotientService;
import com.ieasy.module.oa.project.web.form.CompanyProjectQuotientForm;

@Controller
@RequestMapping("/admin/oa/company_quotient")
public class CompanyProjectQuotientAction extends BaseController {

	@Inject
	private ICompanyProjectQuotientService companyQuotientService ;
	
	@RequestMapping("/company_quotient_main_UI.do")
	public String role_main_UI() {
		return Const.PROJECT + "company_quotient_main_UI" ;
	}
	
	@RequestMapping("/company_quotient_form_UI.do")
	public String role_form_UI(CompanyProjectQuotientForm form, Model model) throws Exception {
		if(null != form.getId() && !"".equals(form.getId())) {
			model.addAttribute("id", form.getId()) ;
		}
		return Const.PROJECT + "company_quotient_form_UI" ;
	}
	
	@RequestMapping("/add.do")
	@ResponseBody
	public Msg add(CompanyProjectQuotientForm form) throws Exception {
		return this.companyQuotientService.add(form) ;
	}
	
	@RequestMapping("/delete.do")
	@ResponseBody
	public Msg delete(CompanyProjectQuotientForm form) throws Exception {
		return this.companyQuotientService.delete(form) ;
	}
	
	@RequestMapping("/update.do")
	@ResponseBody
	public Msg update(CompanyProjectQuotientForm form) throws Exception {
		return this.companyQuotientService.update(form) ;
	}
	
	@RequestMapping("/get.do")
	@ResponseBody
	public CompanyProjectQuotientForm get(String id) throws Exception {
		return this.companyQuotientService.get(id) ;
	}
	
	@RequestMapping("/datagrid.do")
	@ResponseBody
	public DataGrid datagrid(CompanyProjectQuotientForm form) throws Exception {
		return this.companyQuotientService.datagrid(form) ;
	}
}
